package com.yhb.map.views;

import com.yhb.map.R;
import com.yhb.map.views.ScrollView.OnScreenChangeListener;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageView;
import android.widget.LinearLayout;

public class PageControlView extends LinearLayout implements OnScreenChangeListener {

	private Context context;
	public PageControlView(Context context) {
		super(context);
		this.context = context;
	}
	public PageControlView(Context context, AttributeSet attrs) {
		super(context, attrs);
		this.context = context;
	}
	
	@Override
	public void screenChange(int currentTab, int totalTab) {
		this.removeAllViews();
		for(int i = 0; i < totalTab; i++) {
			ImageView iv = new ImageView(context);
			if(i == currentTab) {
				iv.setImageResource(R.drawable.icon_scrollview_cur);
			} else {
				iv.setImageResource(R.drawable.icon_scrollview_notcur);
			}
			this.addView(iv);
		}
		
	}

}
